/*
 * highLeveCommSM.h
 *
 *  Created on: 23/nov/2009
 *      Author: Aleph3
 */

#ifndef HIGHLEVECOMMSM_H_
#define HIGHLEVECOMMSM_H_
#include "stateMachine.h"
#include "stateMachineTester.h"
#define 	HIGH_LEVEL_SEND_OK_CODE 	0x0005
#define 	HIGH_LEVEL_SEND_FAIL_CODE 		0x0006
typedef struct{
	StateMachine super;
	uint32_t msgCounter;
	uint32_t maxMsg;
	uint8_t* buffer;
	uint32_t len;
	uint8_t dst;
	HandShakeMachine handler;
	Notifier onOk;
	Notifier onFail;
} HighLevelCommSM;
void HLCHSMInit(void* me,void* target);
void HLCstateMachineOnInit(void* me,StateHandler initState,uint8_t* buffer,uint32_t len,uint8_t dst);
StateOutcome HLCTransactionState(void* me,const Event* e);
StateOutcome HLCOkState(void* me,const Event* e);
StateOutcome HLCFailState(void* me,const Event* e);
void HLCTransactionToTransaction(void*me);
#endif /* HIGHLEVECOMMSM_H_ */
